public class Solution {
    public boolean increasingTriplet(int[] nums) {
        int len = nums.length;

        int num1 = nums[0];

        int num2 = Integer.MAX_VALUE;

        for (int i = 1; i < len; i++) {
            if (nums[i] <= num1) {
                num1 = nums[i];
            } else if (nums[i] <= num2) {
                num2 = nums[i];
            } else {
                return true;
            }
        }

        return false;
    }
}
